<template>
	<view class="bigView">
		<!-- <view style="width: 100%;display: flex;justify-content: center;color:black;font-weight: bold">需要开放端口</view> -->
		<view style="background-color: white;margin-top: 8px;" v-if="type ==1">
			<!-- <u-cell size="large" title="工号" :value="itemInfo.empId"></u-cell>
			<u-cell size="large" title="姓名" :value="itemInfo.empName"></u-cell>
			<u-cell size="large" title="部门" :value="itemInfo.deptName"></u-cell> -->
			<u-cell size="large" title="实发工资" :value="itemInfo.actualSalary"></u-cell>
			<u-cell size="large" title="应发工资" :value="itemInfo.payableSalary"></u-cell>
			<u-cell size="large" title="应扣工资" :value="itemInfo.deductibleSalary"></u-cell>	
			<u-cell size="large" title="正常工时" :value="itemInfo.normalWorkingHours"></u-cell>
			<u-cell size="large" title="有薪假工时" :value="itemInfo.paidLeaveHours"></u-cell>
			<u-cell size="large" title="法补工时" :value="itemInfo.compensateWorkingHours"></u-cell>
			<u-cell size="large" title="平加时数" :value="itemInfo.wdovHours"></u-cell>
			<u-cell size="large" title="休加时数" :value="itemInfo.wkovHours"></u-cell>
			<u-cell size="large" title="法加工时" :value="itemInfo.lgovHours"></u-cell>
			<u-cell size="large" title="基本工资" :value="itemInfo.basicSalary"></u-cell>
			<u-cell size="large" title="加班工资" :value="itemInfo.overtimeSalary	"></u-cell>
			<u-cell size="large" title="月绩效系数" :value="itemInfo.monthlyPerformanceRatio"></u-cell>
			<u-cell size="large" title="岗评津贴率" :value="itemInfo.evaluationAllowanceRate"></u-cell>
			<u-cell size="large" title="岗位绩效" :value="itemInfo.jobPerformance	"></u-cell>
			<u-cell size="large" title="生活津贴" :value="itemInfo.livingAllowance"></u-cell>
			<u-cell size="large" title="夜班津贴" :value="itemInfo.nightShiftAllowance"></u-cell>
			<u-cell size="large" title="它发" :value="itemInfo.otherPayable"></u-cell>
			<u-cell size="large" title="社保	" :value="itemInfo.socialSecurity"></u-cell>
			<u-cell size="large" title="扣公积金" :value="itemInfo.providentFund"></u-cell>
			<u-cell size="large" title="房租" :value="itemInfo.rentFee"></u-cell>
			<u-cell size="large" title="水电" :value="itemInfo.utilitiesFee"></u-cell>
			<u-cell size="large" title="维修" :value="itemInfo.repairFee"></u-cell>
			<u-cell size="large" title="所得税" :value="itemInfo.incomeTax"></u-cell>
			<u-cell size="large" title="它扣" :value="itemInfo.otherDeductible"></u-cell>
			<u-cell size="large" title="预支工资" :value="itemInfo.advanceSalary"></u-cell>
		</view>
		<view style="background-color: white;margin-top: 8px;" v-else-if="type ==2">
			<u-cell size="large" title="享有年假-天" :value="itemInfo.annualDays"></u-cell>
			<u-cell size="large" title="享有年假-时" :value="itemInfo.annualHours"></u-cell>
			<u-cell size="large" title="年假区间" :value="itemInfo.annualPeriod"></u-cell>
			<u-cell size="large" title="剩余年假-时" :value="itemInfo.remainHours"></u-cell>
			<u-cell size="large" title="已休年假-时" :value="itemInfo.usedHours"></u-cell>
		</view>
		<!-- <view class="bottomView" :style="[{height:bottom + 'px'}]">
			<view class="sure" @click="sureHandle">修改</view>
		</view> -->
	</view>
</template>

<script>
	import mine from '@/api/mine.js'
	export default{
		data(){
			return {
				bottom:0,
				indexList:[1,2],
				dataList:[],
				itemInfo:{},
				type:0
			}
		},
		mounted() {
			uni.getSystemInfo({success: (e) => {
				let custom = wx.getMenuButtonBoundingClientRect();
				this.bottom = custom.bottom;
			}})
		},
		onLoad(options) {
			if(options.type){
				this.type = options.type;
				this.$nextTick(() =>{
					this.initUserInfo()
				})
			}
		},
		methods:{
			initUserInfo(){
				const userInfo = uni.getStorageSync("userInfo")
				if(userInfo){
					this.userInfo = JSON.parse(userInfo)
				}
				this.getUserHandle();
			},
			getUserHandle(){
				if(this.type == 1){
					mine.getHourlyWageInfo({}).then(res =>{
						this.itemInfo = res;
						// uni.setStorageSync("userInfo",JSON.stringify(res))
					}).catch(err =>{
						
					})
				}else if(this.type == 2){// 年假查询
					uni.setNavigationBarTitle({
						title:"年假查询"
					})
					mine.getAnnualLeaveInfo({}).then(res =>{
						console.log(res.dataList)
						this.itemInfo = res.dataList[0];
						// uni.setStorageSync("userInfo",JSON.stringify(res))
					}).catch(err =>{
						
					})
				}else if(this.type == 3){// 年假查询
					uni.setNavigationBarTitle({
						title:"工时查询"
					})
					mine.getWorkingHoursInfo({}).then(res =>{
						console.log(res.dataList)
						this.itemInfo = res.dataList[0];
						// uni.setStorageSync("userInfo",JSON.stringify(res))
					}).catch(err =>{
						
					})
				}
				
			},
			sureHandle(){
				this.usersPutHandle()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bigView{
		width: 100vw;
		height: 100vh;
		background-color: #F7F7F7;
		display: flex;
		flex-direction: column;
		// align-items: center;
		// justify-content: center;
	}
	.itemInput{
		display: flex;
		flex-direction: row;
		height: 51px;
		background-color: white;
		align-items: center;
		width: 100vw;//calc(100vw - 32px);
		border-bottom: rgba(0,0,0,0.08) 1px solid;
	}
	.leftLabel{
		padding-left: 16px;
	}
	
	.bottomView{
		height: 150px;
		width: 100vw;
		// background-color: yellow;
		display: flex;
		justify-content: center;
		margin-top: 10px;
		.sure{
			width: calc(100vw - 104px);//calc(100vw-#{32px});
			height: 48px;
			border-radius: 24px;
			background-color: #247BFD;
			display: flex;
			align-items: center;
			justify-content: center;
			color: white;
		}
	}
</style>